<?php
namespace app\index\controller;
// use think\Controller;
class Index extends Base{
    public function index(){
        // halt($_GET);
        // halt($ind);
        $arr=db('banner')->order('`order` asc')->select();
        $headnews=db('news')->where('type','1')->order('date desc')->find();
        $news3=db('news')->where('type','1')->order('date desc')->limit(3)->select();
        return view('',['arr'=>$arr,'headnews'=>$headnews,'news3'=>$news3]);
    }
    public function search(){
        // halt($_POST);
        $arr=db('news')->where('type','1')->where('title|details','like',"%{$_POST['keywords']}%")->select();
        $count=db('news')->where('type','1')->where('title|details','like',"%{$_POST['keywords']}%")->count();
        return view('',['arr'=>$arr,'count'=>$count]);
    }


}
